<?php
namespace App\Models\Mysql;

use Illuminate\Database\Eloquent\Relations\HasOne;

/**
* @comment 全充商品关联表
*
* @property int $id 自增主键
* @property int $gid 主商品id
* @property int $child_gid 子商品id
* @property int $type 是否是带票的:1=带票,2=不带票
* @property string $merchantnum 商户号
* @property string $create_time 创建时间
*
*/
class XnSupplierGoodsFullyChargedRelation extends BaseModel
{
    /**
     * @var string
     */
    protected $table = 'xn_supplier_goods_fully_charged_relation';

    /**
     * @var string[]
    */
    protected $fillable = ['id', 'gid', 'child_gid', 'type', 'merchantnum', 'create_time'];

    /**
     * @return HasOne
     */
    public function good(): HasOne
    {
        return $this->hasOne(XnSupplierGoods::class, 'id', 'child_gid');
    }
}
